 
 
export interface HistoryItem {
  id: number
  content: string;
  memo?: string;
  environmentId: number;
  status: number;
  createdAt: string;
}
interface Page {
  total: number;
}

  
  export interface ProjectType {
    id?: number;
    name: string;
    description: string
    config?:string
    environments?:EnvironmentType[]
    
  }
  
  export interface EnvironmentType {
    id: number;
    name: string
    description: string;
  }

  export interface Environment{
    id?: number;
    name: string
    description: string
  }
  export interface Response<T> {
        code: number;
        msg: string;
        data: T;
  }
  export interface AxiosRsp<T> {
    status: number;
    data : Response<T>
  }

  export interface QueryProject {
  }
  export interface AuthParam {
    token: string;
  }
export interface LoginParam {
  username: string;
  password: string;
}
  export interface AuthRsp {
    token: string;
    user: {
      username: string
      super: boolean
      id: number
    }
  }
export interface QueryEnv {
}
export interface QueryConfig {
    projectId: number
    environmentId: number
}
export interface PreviewConfig {
  projectId: number
  environmentId: number

  
}
export interface QueryHistoryConfigParam{
  projectId: number
  environmentId?: number
  page?:number
  pageSize?:number
}
export interface QueryHistoryConfigRsp{
  page: Page;
  items: HistoryItem[];
}
export interface GlobalEditParamProps {
  open: boolean
  projectId: number
  name: string
}
export interface ConfigData {
    project: {
        id: number,
        name: string
    },
    dependencyProjectIds:Array<number>,
    content:string;
}

export interface PostConfig {
    projectId: number
    environmentId: number
    dependencyProjectIds:number[]
    content: string
}
export interface PostBaseConfig {
  projectId: number
  content: string
}
export interface BaseCinfigQueryParam {
  projectId: number
}

export interface ConfigPublishParam  {
	projectId  :   number
	environmentId :number
	content     :string
	memo     :string
}
export interface UnConfigPublishParam  {
	projectId  :   number
	environmentId :number
}

export interface HistoryDialogParam {
	projectId  :   number
	projectName  :   string

  
	open  :   boolean
}


export interface AuthSessionData  {
  role: string
  token: string 
  username?:  string
}

export interface  TokenType {
    id?:  number
    desc: string
    value: string
    projectIds: Array<ProjectType>,
    envIds: Array<EnvironmentType>,
}

export interface  TokenFormType {
    id?:  number
    desc: string
    value: string
    projectIds: Array<number>,
    envIds: Array<number>,
}
export interface  TokenRow {
    id?:  number
    desc: string
    value: string
    projectIds: string,
    envIds:string,
}

export interface  FormType {
    id?:  number
    desc: string
    value: string
    projectIds: Array<number>,
    envIds: Array<number>,
}

export interface QueryTokenParam{projectId:number,environmentId:number}


export interface DeleteTokenParam{
  id: number
}


export type AddTokenParam = TokenRow
export type UpdateTokenParam = TokenRow

export type QueryTokenRsp = TokenRow[];


export type ChangePasswordParam = {
  username?: string
  password:string
  oldPassword:string
}

export type ChangeOtherPasswordParam = {
  username: string
  password:string
}


export type AccountType = {
  id: number;
  username: string;
  password: string;
};


export type QueryAcountParam = {
}
export type AddAcountParam = {
  id?: number;
  username: string;
  password?: string;
}

export type PostPermissionParam ={
    username: string
    envCode: string
    proCode: string
}